
#include <bits/stdc++.h>

const int MAXN = 20;
#define LL long long

LL a[MAXN];
LL f[(1 << MAXN) + 5];

LL gcd(LL x, LL y) { return !y ? x : gcd(y, x % y); }

int main() {
  int m, n;
  LL Y;
  scanf("%d%d%lld", &n, &m, &Y);
  for (int i = 0; i < n; ++i)
    scanf("%lld", a + i);

  f[0] = Y;
  for (int S = 1; S < (1 << n); ++S) {
    // 计算 S 的 lcm
    LL l = 1;
    for (int i = 0; i < n; ++i) {
      if ((S >> i) & 1) {
        // l = lcm(l, a[i]);
        LL g = gcd(l, a[i]);
        // l/g*a[i] <= Y
        // l/g <= Y/a[i]
        // <=> l/g <= floor(Y/a[i])
        if (l / g <= Y / a[i]) {
          l = l / g * a[i];
        } else {
          l = Y + 1;
        }
      }
    }
    f[S] = Y / l;
  }
  // g = f

  for (int i = 0; i < n; ++i) {
    for (int S = 0; S < (1 << n); ++S) {
      if (!((S >> i) & 1)) {
        f[S] -= f[S ^ (1 << i)];
      }
    }
  }

  LL ans = 0;
  for (int S = 0; S < (1 << n); ++S) {
    if (__builtin_popcount(S) == m) {
      ans += f[S];
    }
  }
  printf("%lld\n", ans);

  return 0;
}